{% extends "basex.html" %}


{% block title %}
    TRYNE{% if tagline %} - {{ tagline }}{% else %} home{% endif %}
{% endblock %}

{% block topbuttons %}
    {% if tagline %}
        <a href="javascript:javascript:history.go(-1)"
           data-icon="arrow-l"
           data-iconpos="notext">Back</a>
        <a href="/?rnd={{ rnd }}"
           data-icon="home"
           data-iconpos="notext">Home</a>
    {% endif %}
{% endblock %}

{% block collaps %}
    <h3>Tags navigation</h3>
    <small>
        <div class="help">
            <b>Tip:</b>
            {% if not tagline %}
                select tag to view questions about this.
            {% else %}
                select next tags to narrow your focus more. Press back button to return.
            {% endif %}
        </div>
        <ul data-role="listview" data-theme="c">

            {% if tagline %}
                <li data-icon="arrow-l" data-iconpos="left" data-theme="a"><a
                        href="javascript:javascript:history.go(-1)"
                        data-direction="reverse">Back</a></li>
            {% endif %}
            {% for tag in cloud %}
                {% for ele in tag %}
                    {% if forloop.first %}
                        <li><a
                            href='/list?tags={% if tagline %}{{ tagline }},{% endif %}{{ ele }}'>{{ ele }}
                                    {% else %}<span
                                            class="ui-li-count ui-btn-up-c ui-btn-corner-all">{{ ele }}</span></a>
                    {% endif %}
                {% endfor %}
            {% endfor %}

        </ul>
    </small>
{% endblock %}

{% block content %}
    {% if not tagline %}
        <div class="quest" style="line-height: 14px; font-size: 12px;">
            <b>Message of the day:</b>
            Welcome to TRYNE prototype 3!
            Have fun, report errors and join our discussion at <a href="http://groups.google.com/group/tryne"
                                                                  target="_blank">Google groups</a>.
        </div>
    {% endif %}
    <a data-role="button"
       data-icon="plus"
       data-inline="true"
       href='/new?type=question{% if tagline %}&tags={{ tagline }}{% endif %}&rnd={{ rnd }}'>
        Add question</a>
    <a data-role="button"
       data-icon="alert"
       data-inline="true"
       target="_blank"
       data-theme="a"
       rel="external"
       href='http://code.google.com/p/tryne/issues/entry?template=Tester%20report'>
        Report</a>
    <br><br>
    <ul data-role="listview" data-theme="d">
        {% for quest in quests %}
            <li><a href="/quest?id={{ quest.key }}&rnd={{ rnd }}">
                <p style="font-size: 16px;white-space: normal;margin-top: 2px;">{{ quest.text|linebreaksbr }}</p>
                <!-- Bottom info -->
                <p class="tip">
                    {% if quest.solved %}<font color="#377de6"><b>Solved</b></font>&nbsp; {% endif %}
                    {% if quest.answers %}{% else %}<font color="Green"><b>New</b></font>&nbsp; {% endif %}
                    Author: <b>{{ quest.author.nickname|truncatewords_html:1|slugify }}</b> at {{ quest.date }} &nbsp;<br>
                    {% include "num" with n=quest.views word="view" %}
                    <font color="#377de6">{% include "num" with n=quest.answers word="answer" %}</font>
                    <font color="blue">{% include "num" with n=quest.nodes word="node" %}</font>
                    <font color="green">{% include "num" with n=quest.facts word="fact" %}</font>
                </p>

            </a></li>
        {% endfor %}
    </ul>
    {% if quests %}{% else %}
        <font size="6" color="#CCCCCC">No questions</font>
    {% endif %}
{% endblock %}